<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>openyelp</title>
[#include "/theme/yelp/common/scripts.html"]

<link rel="stylesheet" href="${siteurl}assets/css/www-pkg.css" />
<link rel="stylesheet" href="${siteurl}assets/css/events.css" />
<link rel="stylesheet" href="${siteurl}assets/plugs/datetimepicker/jquery.datetimepicker.css" />
<script type="text/javascript" src="${siteurl}assets/plugs/datetimepicker/jquery.datetimepicker.js"></script>


<script type="text/javascript">
	$(document).ready(function() {

		$("#end-date-toggle").click(function() {
			$("#end_date").toggle();
			if ($("#end_date").is(":hidden")) {
				$("#end-date-toggle").text("新增結束時間");
				$("#use_end_time").val("1");
			} else {
				$("#end-date-toggle").text("移除結束時間");
				$("#ends_time").val("");
				$("#ends_month_day_year").val("");
				$("#use_end_time").val("0");
				
			}

		});
		$("#starts_time").datetimepicker({
			  datepicker:false,
			  format:'H:i',
			  step:15
		});
		$("#ends_time").datetimepicker({
			  datepicker:false,
			  format:'H:i',
			  step:15
		});
		
		$("#free").click(function(data){
			
			
			if($("#free").attr("checked")==true){
				alert($(this).val());
			}else{
				
			}
		});
		$("input[name='venue_type']").change(function(data){
			
			if($(this).val()=="private"){
				
				
				$("#find_business_pane").hide();
				$("#create_venue_pane").show();
			}else{
				$("#find_business_pane").show();
				$("#create_venue_pane").hide();
			}
		}); 
		
		$("#starts_month_day_year").datetimepicker({
			  format:'Y-m-d',
			  onShow:function( ct ){
			   this.setOptions({
			    maxDate:jQuery('#ends_month_day_year').val()?jQuery('#ends_month_day_year').val():false
			   })
			  },
			  timepicker:false
		});
		$("#ends_month_day_year").datetimepicker({
			  format:'Y-m-d',
			  onShow:function( ct ){
			   this.setOptions({
			    minDate:jQuery('#starts_month_day_year').val()?jQuery('#starts_month_day_year').val():false
			   })
			  },
			  timepicker:false
		});
		
	});
</script>
</head>

<body class="country-hk logged-out ytype jquery" id="yelp_main_body"
	ryt13230="1">

	<div id="fb-root"></div>

	<div class="lang-en" id="wrap">



		[#include "/theme/yelp/common/header.html"]

		<div id="print-masthead">
			<img alt="Yelp" class="print-bkg-img"
				src="http://s3-media2.fl.yelpcdn.com/assets/2/www/img/b7e9d647188d/gfx/header_print.gif">
		</div>

		<span class="offscreen" id="page-content">&nbsp;</span>

		<div class="main-content-wrap main-content-wrap--box">

			<div class="content-container" id="super-container">


				<div id="alert-container"></div>


				<div class="container create-event-page">
					<div class="clearfix page-header">
						<h1 class="heading">提交活动</h1>
						<a href="${siteurl}events.htm">返回活动</a>

					</div>
					<div class="clearfix layout-block layout-a">
						<div class="column column-alpha ">



							<form method="POST" id="create_event" 
								class="yform ytype">
								<input type="hidden"
									value="577cc28cf2c1642c2f99bb26563fc690cbfde966680957a9236fb8ae22576736"
									class="csrftok" name="csrftok"> <label
									for="event_title">活动名称</label>
									 <input type="text" required="required"
									maxlength="128" value="" id="event_title" name="name">

								<label for="starts_month_day_year">时间</label>
								<div class="cal_fields clearfix">

									<div class="datetime-picker">
										<div class="nested-icon-label date-picker">
											<i class="i ig-common i-calendar-gray-common"></i> <input
												type="text" title="yyyy/mm/dd" name="starts_month_day_year"
												id="starts_month_day_year" data-date-format="yyyy/MM/dd"
												class="date-input ">
										</div>




										<div class="time-picker">
											<input type="text" name="starts_time" id="starts_time"
												class="time-input ">
										</div>


									</div>


									<input type="hidden" value="" id="use_end_time"
										name="use_end_time">
									<div style="display: none;" class="inline-block" id="end_date">
										<strong>至</strong>
										<div class="datetime-picker">
											<div class="nested-icon-label date-picker">
												<i class="i ig-common i-calendar-gray-common"></i> <input
													type="text" title="yyyy/mm/dd" name="ends_month_day_year"
													id="ends_month_day_year" data-date-format="yyyy/MM/dd"
													class="date-input ">
											</div>




											<div class="time-picker">
												<input type="text" name="ends_time" id="ends_time"
													class="time-input ">
											</div>


										</div>

									</div>
									<a id="end-date-toggle" href="#" class="smaller"> 新增结束时间 </a>
								</div>

								<label for="selected_business">边度</label>
								<div id="venue_picker">
									<fieldset id="venue_picker_tabs">
										<label class="radio-check" for="biz_tab"> <input
											type="radio" checked="" value="public" name="venue_type"
											id="biz_tab"> <span>公开场地</span>
										</label> <label class="radio-check" for="add_tab"> <input
											type="radio" value="private" name="venue_type" id="add_tab">
											<span>私人地址</span>
										</label>
									</fieldset>

									<div id="find_business_pane">
										<div id="venue_picker_container">
											<div class="business_finder clearfix">
												<div class="form_container clearfix">
													<label class="query_label">商店名称<input type="text"
														name="query" class="text" placeholder="太兴，扒王之王"></label><label
														class="location_label">邻近<input type="text"
														name="location" class="text" placeholder="香港"></label>
													<div class="submit_container">
														<button
															class="ybtn ybtn-secondary ybtn-small searchButton"
															value="submit" type="submit">
															<span>搜寻</span>
														</button>
														<span class="js-loading-animation throbber"
															style="display: none;"></span>
													</div>
												</div>
											</div>
										</div>
										<div id="selected_business"></div>
										<input type="hidden" value="" name="enc_business_id"
											id="business_id">
										<p style="display: none;" id="similar_event_msg">可能已经有人新增该活动。
											请在提交活动前先检查右方的现有活动。</p>
									</div>

									<div style="display: none;" id="create_venue_pane">
										<label for="venue_name"> 姓名 </label> <input type="text"
											value="" id="venue_name" name="venue_name"> <label
											for="venue_street"> 地址 </label> <input type="text" value=""
											id="venue_street" name="venue_street"> <label
											for="venue_city_state_zip"> 城市 </label> <input type="text"
											value="${city.name!''}" id="venue_city_state_zip"
											name="venue_city_state_zip">

										<div class="hr-line"></div>
									</div>
								</div>

								<label for="description">为何及点解</label>
								<div id="description_fields">
									<textarea placeholder="Sell 吓佢啦！ 用你自己嘅文字－话俾人听点解"
										id="description" name="description"></textarea>
								</div>

								<label for="yelp_community">对象是</label>
								<fieldset id="event_audience">
									<label for="yelp_community:False"> <input type="radio"
										checked="checked" value="1" id="yelp_community:False"
										name="community" class="radio"> <span>每人</span>
									</label> <label for="yelp_community:True"> <input type="radio"
										value="2" id="yelp_community:True" name="community"
										class="radio"> <span>Yelp社群</span>
									</label>
								</fieldset>

								<legend>参加方法</legend>
								<div id="event_logistics">
									<label for="event_site_url"> 活动网页 URL： </label> <input
										type="text" value="" id="event_site_url" name="event_site_url"
										class="url"> <label for="tickets_url"> 门票网页连结：
									</label> <input type="text" value="" id="tickets_url"
										name="tickets_url" class="url">

									<div class="cost">
										<label for="cost">价格：</label> $ 
										<input type="number" value=""  reg="/^[0-9]*[1-9][0-9]*$/" tip="一定要选择哟"
											id="cost" name="cost"> 至 
											
											<input type="number" value=""  
											id="cost_max" name="cost_max"> 或是 <input
											type="checkbox" 
											id="free" name="free" value="1"> <label
											class="free" for="free">免费活动</label>
									</div>
								</div>

								<label>分类</label> <select name="category.id"> [#if
									list??] [#list list as item]
									<option value="${item.id}">${item.name}</option> [/#list]
									[/#if]
								</select>


								<button class="ybtn ybtn-primary disable-on-submit ytype"
									value="Submit" type="submit" name="action_submit"
									id="create-event">
									<span>建立活动</span>
								</button>
								<input type="submit" class="strong_pseudolink" id="cancel"
									value="取消" name="action_cancel">

							</form>


						</div>
						<div class="column column-beta ">
							<div style="display: none;" id="similar_events_box"></div>

						</div>

					</div>
				</div>


			</div>
		</div>

		<!-- google_ad_section_start(weight=ignore) -->
		<!-- <a href="/biz/outlook-autumn-market-fundamental-catwalk-flimsy-roost-legibility-individualism-grocer-predestination-2">yelp</a> -->
		[#include "/theme/yelp/common/footer.html"]


	</div>



</body>

</html>